package edu.olin.scheduler.gui.schedule;

import java.awt.Color;
import java.awt.Graphics;

public class GUIArrow {
    
    private int x;
    private int y;
    private int width;
    private int height;
    
    public int getX(){ return x; }
    public void setX(int x){ this.x = x; }
    
    public int getY(){ return y; }
    public void setY(int y){ this.y = y; }
    
    public void setPosition(int x, int y){
        setX(x);
        setY(y);
    }
    
    public int getWidth(){ return width; }
    public void setWidth(int width){ this.width = width; }
    
    public int getHeight(){ return height; }
    public void setHeight(int height){ this.height = height; }
    
    public void paint(Graphics g){
        int[] xpoints = new int[]{ x, x+width/2, x+width, x }; //x-points of triangle
        int[] ypoints = new int[]{ y, y+height, y, y }; //y-points of triangle
        g.setColor(Color.BLACK);
        g.fillPolygon(xpoints,ypoints,3); //3 line segments
    }
    
    public GUIArrow(int width, int height){
        this.width = width;
        this.height = height;
        }
    
}
